#!/usr/bin/env python3

# 每个状态记录着 Allow 选项
OpenningStatus = ["close"]
ClosingStatus  = ["open", "move", "stop"]
MovingStatus   = ["stop"]
StoppingStatus = ["open", "move"]

class Lift:
    def __init__(self):
        self._currStatus = StoppingStatus

    def open_door(self):
        if "open" in self._currStatus:
            print("开门")
            self._currStatus = OpenningStatus
        else:  print("无法执行操作")

    def close_door(self):
        if "close" in self._currStatus:
            print("关门")
            self._currStatus = ClosingStatus
        else:  print("无法执行操作")

    def move(self):
        if "move" in self._currStatus:
            print("运行")
            self._currStatus = MovingStatus
        else:  print("无法执行操作")

    def stop(self):
        if "stop" in self._currStatus:
            print("停止")
            self._currStatus = StoppingStatus
        else:  print("无法执行操作")

if __name__ == "__main__":
    lift = Lift()
    lift.open_door()
    lift.move()
    lift.stop()
    lift.close_door()